<div id="content">
                    	<h3>Sửa thông tin sản phẩm</h3>
                        
                        <a class="back" href="<?php echo base_url() ?>index.php/Quanlysanpham/index">Quay lại</a>
                        
                        <div id="contentFunc">
                        	<?php 
								$attributes = array('id'=>'frmCapNhatSP','name'=>'frmCapNhatSP','enctype'=>'multipart/form-data');
								echo form_open_multipart('Quanlysanpham/sua/'.$sanpham['masp'],$attributes);	
								
							?>
                              <div class="blockSP">
                                <label class="lblSanPham" for="txtTenSP">Tên sản phẩm:</label>
                                <input class="input" type="text" id="txtTenSP" name="tensanpham" value="<?php echo $sanpham['tensanpham']?>"/>
                              </div>
                               <div class="blockSP">
                                <label class="lblSanPham" >Danh mục:</label>
                                <?php 
								if(!empty($danhmucs))
								{
									if(is_array($danhmucs))
									{
											$options = array();
											foreach ($danhmucs as $item)
											{
												$options[$item['madm']]=$item['tendanhmuc'];
											}
											 if(!empty($sanpham['ma_dm']))
											{
												echo form_dropdown('ma_dm', $options, $sanpham['ma_dm']); 
											}
											 else
											{
												echo form_dropdown('ma_dm', $options);
											}
									}
								}		 
								?>
							
                              </div>
                              <div class="blockSP">
                                <label class="lblSanPham" for="txtMoTaSP">Mô tả:</label>
                                <textarea class="input" id="txtMoTaSP" name="mota" ><?php echo $sanpham['mota']?></textarea>
                              </div>
                               <div class="blockSP">
                                <label class="lblSanPham" for="txtMoTaSP_En">Mô tả (tiếng Anh):</label>
                                <textarea class="input" id="txtMoTaSP_En" name="mota_en"  ><?php echo $sanpham['mota_en']?></textarea>
                              </div>
                              <div class="blockSP">
                                <label class="lblSanPham" for="txtDonGia">Đơn giá:</label>
                                <input class="input" type="number" id="txtDonGia" name="dongia" value="<?php echo $sanpham['dongia']?>"/>
                              </div>
                              
                              <div class="blockSP">
                                <label class="lblSanPham" for="txtSoLuongTon">Số lượng:</label>
                                <input class="input" type="number" id="txtSoLuongTon" name="soluong" value="<?php echo $sanpham['soluong']?>"/>
                              </div>
                              
                              <div id="chiTietSP">
                                <label id="lblChiTiet" for="txtChiTietSP">Tiếng Việt:</label>
                                <textarea id="txtChiTietSP" name="chitiet" ><?php echo $sanpham['chitiet']?></textarea>
                                
                                <script type="text/javascript">
                                	CKEDITOR.replace("txtChiTietSP");
                                </script>
                              </div>
                               <div id="chiTietSP">
                                <label id="lblChiTiet" for="txtChiTietSP">Tiếng Anh:</label>
                                <textarea id="txtChiTietSP_En" name="chitiet_en" ><?php echo $sanpham['chitiet_en']?></textarea>
                                
                                <script type="text/javascript">
                                	CKEDITOR.replace("txtChiTietSP_En");
                                </script>
                              </div>
                              <div class="blockSP">
                                <label class="lblSanPham" for="txtDonViTinh">Đơn vị tính:</label>
                                <input class="input" type="text" id="txtDonViTinh" name="donvitinh" value="<?php echo $sanpham['donvitinh']?>"/>
                              </div>
                              
                              <div class="blockSP">
                                <label class="lblSanPham" for="filHinhDaiDien">Hình đại diện:</label>
                                <input class="input" type="file" id="filHinhDaiDien" name="filHinhDaiDien" />
                              </div>
                              <div class="img">
                       
                              	<img src="<?php echo base_url().$sanpham['hinh']?>" alt="đại diện" width="200" height="200"/>
                              </div>
                              <div class="blockSP">
                                <label class="lblSanPham" for="filHinh">Hình nhỏ:</label>
                                <input class="input" type="file" id="filHinh" multiple="multiple" name="filHinh[]"/>
                              </div>
                              <div class="lstimg">
                              	<?php 
									if(!empty($hinhs))
									{
										foreach ($hinhs as $h)
										{
											echo "<img  src='".base_url().$h['tenhinh']."' alt='".$h['mah']."' width='100' height='200'/>";
										}	
									}
								?>
                              </div>
                              <?php 
								echo validation_errors();
								if(!empty($img['error_upload']))
								{
									echo $img['error_upload'];
								}
								if(!empty($thongbao))
								{
									echo $thongbao;
									}				
							  ?>
                              <div class="blockSP button">
                              	<input type="submit" id="btnThemSP" value="Lưu" />
                				<input type="reset" name="btnHuyBo" id="btnHuyBo" value="Hủy bỏ" />
                              </div>
                           </form>
                        </div>
                    </div>
            </div>